package com.viknix.threadpool.manager.client.listener;

import com.viknix.threadpool.manager.client.consistency.CacheData;

/**
 * @Author: Dongqi
 * @Date: 2021/10/24 19:33
 * @Version 1.0
 * @Description: 动态线程池监听器包装类
 */
public class ManagerListenerWrap {
    public final Listener listener;
    public String lastCallMd5 = CacheData.getMd5String(null);

    public ManagerListenerWrap(Listener listener) {
        this.listener = listener;
    }

    public ManagerListenerWrap(Listener listener, String md5) {
        this.listener = listener;
        this.lastCallMd5 = md5;
    }

    @Override
    public boolean equals(Object obj) {
        if (null == obj || obj.getClass() != getClass()) {
            return false;
        }
        if (obj == this) {
            return true;
        }
        ManagerListenerWrap other = (ManagerListenerWrap) obj;
        return listener.equals(other.listener);
    }

    @Override
    public int hashCode() {
        return super.hashCode();
    }
}
